<?php

namespace JsonLowCode;

use Closure;
use JsonLowCode\Factory\UIFactory;
use JsonLowCode\UI\Icon;

/**
 * @method static UI\Affix affix(mixed $children = null) 固钉 Affix
 * @method static UI\Alert alert(mixed $children = null) Alert
 * @method static UI\Anchor anchor($options = []) 侧边导航 Anchor
 * @method static UI\AnchorLink anchorLink($options = []) 侧边导航锚点链接 AnchorLink
 * @method static UI\Avatar avatar(string $src = "",mixed $children = null) 头像组件 Avatar
 * @method static UI\AvatarGroup avatarGroup(array $options = [],mixed $children = null) 头像组 AvatarGroup
 * @method static UI\AppAction appAction(mixed $children = null) 行为组件 AppAction
 * @method static UI\AppCode appCode(string $title,string $code = null, string $bindName = null) 代码显示组件 AppCode
 * @method static UI\AppLink appLink(mixed $children = null) AppLink组件
 * @method static UI\AppLogin appLogin(string $title = "", string $moduleName = "", mixed $children = null) AppLink组件
 * @method static UI\AppTable appTable() AppTable 组件
 * @method static UI\Badge badge(mixed $children = null) 标记组件 Badge
 * @method static UI\Block block(mixed $children = null) page 页面组件
 * @method static UI\Blockquote blockquote(mixed $children = null) Blockquote 标签
 * @method static UI\Button button(mixed $children = null, string|Icon $icon = null, string $iconPlacement = "left") Button 按钮组件
 * @method static UI\ButtonGroup buttonGroup(mixed $children = null) ButtonGroup 按钮组件
 * @method static UI\Card card(string|Schema $title = null,  mixed $children = null) Card 卡片组件
 * @method static UI\Checkbox checkbox() Checkbox 单选组件
 * @method static UI\Checkboxes checkboxes(string|int|bool $value = "", bool $isJSExpression = false) Checkbox 单选复组件
 * @method static UI\ColorPicker colorPicker() colorPicker 颜色选择组件
 * @method static UI\Carousel carousel(array $images = []) Carousel 轮播图组件
 * @method static UI\Collapse collapse(mixed $children = null) Collapse 组件
 * @method static UI\CollapseItem collapseItem(string $title = null,  mixed $children = null) CollapseItem 组件
 * @method static UI\CollapseTransition collapseTransition(mixed $children = null) CollapseTransition 组件
 * @method static UI\ConfigProvider configProvider(string $theme = null) configProvider主题组件
 * @method static UI\Countdown countdown(bool|null $active = null, string|int|null $duration = null, string|int|null $precision = null) Countdown 倒计时组件
 * @method static UI\DarkModeSwitch darkModeSwitch() DarkModeSwitch主题切换按钮
 * @method static UI\DatePicker datePicker() DatePicker日期组件
 * @method static UI\DynamicInput dynamicInput() DynamicInput组件
 * @method static UI\DynamicTags dynamicTags() DynamicTags组件
 * @method static UI\Drawer drawer(string $title = "", mixed $children = null) Drawer弹窗组件
 * @method static UI\Divider divider(mixed $children = null) Divider分割线组件
 * @method static UI\Dropdown dropdown(string|int $key) Dropdown 下拉菜单
 * @method static UI\El el(mixed $children = null) 元素Element组件
 * @method static UI\Ellipsis ellipsis(mixed $children = null) 文本省略组件
 * @method static UI\Exception exception(string|int $type = null) ExceptionBase 页面组件
 * @method static UI\Form form(mixed $children = null) form表单组件
 * @method static UI\UploadManager uploadManager() FileManager组件
 * @method static UI\GithubSite githubSite(string $link) GithubSite组件
 * @method static UI\GradientText gradientText(string $type = 'primary') GradientText组件
 * @method static UI\Grid grid(int|string $cols = 24, int|string $xGap = 0, int|string $yGap = 1, mixed $children = null) Grid组件
 * @method static UI\GridItem gridItem(mixed $children = null, int $span = 1, int $offset = 0) Grid组件
 * @method static UI\H h(mixed $children = null,int $deep = 1) h1 - h6 标签组件
 * @method static UI\Html html(mixed $children = null, string $tag = 'div') html标签组件
 * @method static UI\KeepRouter keepRouter() keepRouter 组件
 * @method static UI\Image image(string $src = null) Image 图片组件
 * @method static UI\ImageGroup imageGroup(string $src = null) ImageGroup 图片组件
 * @method static UI\ImageVerify imageVerify() ImageVerify 图片验证码组件
 * @method static UI\Input input(string $type = 'text', mixed $value = null) Input 输入组件
 * @method static UI\InputNumber inputNumber(mixed $value = null) 数字 输入组件
 * @method static UI\InputGroup inputGroup(mixed $children = null) InputGroup 输入组组件
 * @method static UI\InputGroupLabel inputGroupLabel(mixed $children = null) InputGroupLabel 输入组label组件
 * @method static UI\Icon icon(string $name = "") 图标组件
 * @method static UI\Link link(mixed $children = null, string|Icon $icon = null, string $iconPlacement = "left") Link组件
 * @method static UI\Modal modal(string $title = "",mixed $children = null) modal 弹窗组件
 * @method static UI\NEmpty empty(string $description = null, mixed $children = null) modal 弹窗组件
 * @method static UI\NSwitch switch(string|int|bool $value = "") NSwitch 开关组件
 * @method static UI\NumberAnimation numberAnimation(int $from = 0,int $to = null) NumberAnimation 数字动画组件
 * @method static UI\P p(mixed $children = null) p 标签组件
 * @method static UI\Page page(mixed $children = null) page 页面组件
 * @method static UI\PageHeader pageHeader(string $title, string $subtitle = "", mixed $children = null) pageHeader 页面组件
 * @method static UI\PopConfirm popConfirm(mixed $children = null) Popover 弹出信息组件
 * @method static UI\Popover popover(mixed $children = null) Popover 弹出信息组件
 * @method static UI\Radio radio(string|int|bool $value = "") Radio 单选组件
 * @method static UI\Rate rate(string|int $value = "") Rate 评分组件
 * @method static UI\Result result(string $title = "",mixed $children = null) Result 结果组件
 * @method static UI\SfcLocal sfcLocal(string $view = null, array $data = []) SfcLocal 本地Sfc组件
 * @method static UI\SfcApi sfcApi(string $api = null) SfcApi 远程Sfc组件
 * @method static UI\Skeleton skeleton(string|int $width = null,string|int $height = null, string $size = 'medium') Skeleton 骨架屏组件
 * @method static UI\Slider slider() Slider 滑块组件
 * @method static UI\Space space(mixed $children = null) Space 间距组件
 * @method static UI\Spin spin(mixed $children = null) Spin 加载组件
 * @method static UI\Statistic statistic(string|int $value = "") Statistic 统计数据组件
 * @method static UI\SvgIcon svgIcon(string $name = "") 图标组件
 * @method static UI\Tabs tabs(mixed $children = null) tabs 标签面板组件
 * @method static UI\Tag tag(mixed $children = null) tag 标签组件
 * @method static UI\Text text(mixed $children = null) Text 组件
 * @method static UI\Thing thing(mixed $children = null) Thing 组件
 * @method static UI\TimePicker timePicker() TimePicker 时间组件
 * @method static UI\Tooltip tooltip(mixed $children = null) 弹出提示组件
 * @method static UI\Tree tree(array $data = []) Tree组件
 * @method static UI\Ul ul(Closure $children = null, string $as = "Ul") ul组件
 * @method static PageCache setState(string $key, mixed $value,string $cacheKey = null) 设置page组件states数据
 * @method static PageCache setStates(array $states,string $cacheKey = null) 设置page组件states数据
 * @method static array|mixed getStates(string $key = "",string $cacheKey = null) 获取page组件states数据
 * @method static PageCache setMethods(string $key, string $value,string $cacheKey = null) 设置page组件states数据
 * @method static array getMethods(string $cacheKey = null) 获取page组件states数据
 * @method static PageCache setSourceList(string $key, array|Axios $value,string $cacheKey = null) 设置page组件页面远程数据源
 * @method static array getSourceList(string $cacheKey = null) 获取page组件页面远程数据源
 * @method static PageCache setMaps(string $name, Map $map,string $cacheKey = null) 设置组件映射
 * @method static array getMaps(string $cacheKey = null) 获取组件映射
 * @method static PageCache defineBlock(string $name, Closure $schema,string $cacheKey = null) 区块组件定义
 * @method static array getDefineBlock(string $cacheKey = null) 获取定义的区块组件列表
 */
class UI
{
    /**
     * 页面信息内容
     * @param Schema|Closure $content
     * @param array<int,Package|array> $packages
     * @return Content
     */
    public static function content(Schema|Closure $content, array $packages = []): Content
    {
        return Content::make($content)->packages($packages);
    }

    /**
     * @param string $method
     * @param array $args
     * @return mixed
     */
    public static function __callStatic(string $method, array $args)
    {
        return UIFactory::make()->$method(...$args);
    }
}
